import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import MenuView from "../views/MenuView.vue"

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/menu',
      name: 'menu',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: MenuView,
      children:[{
        path:"",
        name:"",
        component:()=>import ("../views/BannerView.vue")
      },
      {
        path:"banner",
        name:"banner",
        component:()=>import ("../views/BannerView.vue")
      },
      {
        path:"type",
        name:"type",
        component:()=>import ("../views/TypeView.vue")
      },
      {
        path:"goods",
        name:"goods",
        component:()=>import ("../views/GoodsView.vue")
      },
      {
        path:"signature",
        name:"signature",
        component:()=>import ("../views/SignatureView.vue")
      },
      {
        path:"map",
        name:"map",
        component:()=>import ("../views/MapView.vue")
      },
      {
        path:"zhibo",
        name:"zhibo",
        component:()=>import ("../views/ZhiBo.vue")
      },
      {
        path:"test",
        name:"test",
        component:()=>import ("../views/TestView.vue")
      }
    ]
    }
  ]
})

export default router
